﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AppDesigner.File
{
    public class FileHelper
    {
        public static string ReadSolutionFile(string filePath)
        {
            using (Stream stream = Application.GetResourceStream(new Uri(filePath, UriKind.Relative)).Stream)
            {
                int i = 0;
                byte[] byteArray = new byte[1024 * 8];
                MemoryStream memoryStream = new MemoryStream();
                while ((i = stream.Read(byteArray, 0, byteArray.Length)) > 0)
                {
                    memoryStream.Write(byteArray, 0, i);
                }
                return Encoding.UTF8.GetString(memoryStream.ToArray(), 0, memoryStream.ToArray().Length);
            }
        }
    }
}
